<template>
	<view>
		<view style="margin: 30rpx;">绑定列表</view>
		<view class="bindlist " v-for="item in list">
			<view class="bindlist_top flex">
				<view class="bindlist_top_left flex">
					<image :src="$oss(item.avatar)" class="avatar" mode=""></image>
					<view class="bindlist_top_left_text flex u-font-26">
						<text>{{item.nickname}}</text>
						<text style="color: #ADB1BF;">id: {{item.id}}</text>
					</view>
				</view>
				<view class="bindlist_top_right flex">
					<text style="color: #E91919;" class="u-font-bold u-font-40">{{item.order_price}}</text>
					<text class="u-font-26" style="color: #ADB1BF;">已消费(元)</text>
				</view>
			</view>
			<view class="bindlist_bottom u-font-26" style="color: #CCCFD8;">
				加入时间 {{item.createtime | date('yyyy-mm-dd')}}
			</view>
		</view>
		<u-empty v-if="list==''" text="暂无信息"></u-empty>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[],
				id:''
			};
		},
		onLoad(option) {
			this.id = option.id
			this.$api.post('/userrec',{user_id:option.id,page:this.page}).then(res => {
				if (res.code == 1) {
					this.list = [...this.list,...res.data]
				}
			}).catch((res) => {
			
			})
		},
		methods:{
			init(){
				this.$api.post('/userrec',{user_id:this.id,page:this.page}).then(res => {
					if (res.code == 1) {
						this.list = [...this.list,...res.data]
					}
				}).catch((res) => {
				
				})
			},
		},
		onReachBottom() {
			this.page++
			this.init()
		},
	}
</script>

<style lang="scss">
.bindlist {
		margin: 0 auto 30rpx;
		width: 90%;
		box-sizing: border-box;
		border-radius: 30rpx;
		background-color: #FBFBFE;

		.bindlist_top {
			padding: 30rpx;
			justify-content: space-between;
			align-items: center;
			background-color: #fff;
			border-radius: 30rpx;

			.bindlist_top_left {
				align-items: center;

				.avatar {
					width: 77rpx;
					height: 77rpx;
					border-radius: 50%;
					margin-right: 20rpx;
				}

				.bindlist_top_left_text {
					flex-direction: column;
					height: 77rpx;
					justify-content: space-between;
				}
			}

			.bindlist_top_right {
				justify-content: space-between;
				flex-direction: column;
				align-items: center;
				// height: 77rpx;
			}
		}

		.bindlist_bottom {
			// text-align: center;
			padding: 10rpx 30rpx;
		}
	}
</style>
